<div class="page-3 cart commonPage">
	<div class="bg-3"></div>
	<?php echo $this->element('sidebar'); ?>
	<div class="box-right zhigh">
        <?php echo $this->element('banner'); ?>
            <div class="title">
                <ul class="breadcrumbs">
                    <li><a href="<?php echo $this->General->base_url() ?>"><img style="position: relative; top: 2px;" src="<?php echo $this->webroot ?>images/home-yl-2.png" /></a></li>
                    <?php
                        foreach($breadcrumbs as $breadcrumb)
                        {
                            echo '<li><a href="'.$this->General->base_url().$breadcrumb['link'].'">'.$breadcrumb['title'].'</a></li>';
                        }
                    ?>
                </ul>
			</div>
		<?php echo $this->element('header'); ?>
		<div class="box-content">
			<div class="post-content">

                <div class="form-login">
                    
                    <form id="contact_form" name="" method="post" action="">
                        <h4>Đổi mật khẩu</h4>
                        <?php echo $this->Session->flash(); ?>
                        <p>
                            <label>Mật khẩu cũ:</label>
                            <input type="password" name="data[User][password]" value="" />
                        </p>
                        <p>
                            <label>Mật khẩu mới:</label>
                            <input type="password" id="password_update" name="data[User][password_update]" value="" />
                        </p>
                        <p>
                            <label>Nhập lại mật khẩu mới:</label>
                            <input type="password" name="data[User][re_password_update]" value="" />
                        </p>
                        <p>
                            <input type="submit" name="" value="Thay đổi" />
                        </p>
                    </form>
                </div>
            </div>
		</div>
	</div>
	<?php echo $this->element('footer'); ?>
</div>
<script>
    $(document).ready(function(){
        var validator = $("#contact_form").validate({ 
        rules: { 
            'data[User][password]': "required", 
            'data[User][password_update]': {
                required: true, 
                minlength: 6, 
            }, 
            'data[User][re_password_update]': {
                equalTo: "#password_update"
            }
        }, 
        messages: { 
            'data[User][password]': "Điền mật khẩu cũ.", 
            'data[User][password_update]': {
                required: "Điền mật khẩu mới.", 
                minlength: "Mật khẩu ít nhất 6 ký tự", 
            },
            'data[User][re_password_update]': {
                equalTo: "Nhập lại mật khẩu chưa giống nhau"
            }
        }
    });

        
    });
</script>
